<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户中心 - 注册</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/static/user/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/user/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/static/user/css/animate.css" rel="stylesheet">
    <link href="/static/user/css/style.css?v=4.1.0" rel="stylesheet">
	<link href="/static/user/css/login.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="signin">

    <div class="middle-box text-center loginscreen   animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">BY</h1>

            </div>
            <h3>欢迎注册 Boyou Network</h3>
            <p>注册账户</p>
            <form class="m-t" role="form" action="{:url('register')}">
                <div class="form-group">
                    <input type="text" name="account" class="form-control" id="sendMsgPhone" placeholder="请输入手机号码" required="">
                </div>

                <div class="form-group">
                    <div class="col-md-6" style="padding: 0;"><input type="text" name="code" id="sendMsgCode" class="form-control" placeholder="验证码" required></div>
                    <div class="col-md-6" style="padding: 0;"><img class="verifyimg" alt="image" src="{:url('verifyImg')}" style=" width: 85%; height: 31px; float: right;"></div>
                </div>

                <div class="form-group">
                    <div class="col-md-6" style="padding: 0;"><input type="text" name="code" class="form-control" placeholder="短信验证码" required></div>
                    <div class="col-md-6" style="padding: 0;">
                        <button onclick="sendMsg('sendMsg',1)" id="sendMsgBtn" class="btn btn-w-m btn-success block m-b" type="button" style="float: right;
">获取短信验证码</button>
                    </div>
                </div>

                <div class="form-group">
                    <input type="password" name="password" class="form-control" placeholder="3-20位大小写字母，数字及'_'组合">
                </div>

                <div class="form-group">
                    <input type="password" name="repassword" class="form-control" placeholder="请再次输入密码" required="">
                </div>

                <button type="submit" class="btn btn-w-m btn-success block full-width m-b">注 册</button>
                <div class="check-tips" style="color:#ff0000;"></div>
                <p class="text-muted text-center"><small>已经有账户了？</small><a href="login.html">点此登录</a>
                </p>

            </form>
        </div>
    </div>

    <!-- 全局js -->    
    <script src="/static/user/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/user/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- iCheck -->
    <script src="/static/user/js/sms.js?c=52"></script>
    <script>
        $(function(){
            //刷新验证码
            var verifyimg = $(".verifyimg").attr("src");
            $(".verifyimg").click(function(){
                if( verifyimg.indexOf('?')>0){
                    $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
                }else{
                    $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
                }
            });

            $("form").submit(function(){
                var self = $(this);
                $.post(self.attr("action"), self.serialize(), success, "json");
                return false;

                function success(data){
                    if(data.code){
                        window.location.href = data.url;
                    } else {
                        self.find(".check-tips").text(data.msg);
                        //刷新验证码
                        $(".verifyimg").click();
                    }
                }
            });

        })
    </script>

    
    

</body>

</html>
